package com.joshua.spring.jobs;

import com.joshua.spring.util.JacksonUtils;
import lombok.extern.slf4j.Slf4j;
import org.quartz.*;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * projectName dragon-cloud
 * package com.joshua.spring.jobs
 * classname  DemoJob
 * <p>
 * description 定时任务示例
 * </p>
 *
 * @author <a href="mailto:joshualwork@163.com">joshua_liu</a>
 * @date 2020/9/13 15:43
 */
@Slf4j
public class DemoJob extends QuartzJobBean {
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        JobDataMap map = jobExecutionContext.getJobDetail().getJobDataMap();
        String mapInfo = JacksonUtils.mapToJson(map);
        log.info(mapInfo);
    }
}
